
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
/*
using System;
using System.IO;
using System.Collections;
using System.Xml;

using Swaf.Container;

namespace Swaf.Messaging
{
	/// <summary>
	/// Summary description for MessagingConnection
	/// </summary>
	public class MessagingConnection : INameAddressSupport
	{
		protected IDictionary map = new Hashtable();
		protected static string defaultPort="1414";

		#region INameAddressSupport Members
		public MessagingConnection(XmlElement el)
		{
			initializeFromElement(el);
		}
		protected void initializeFromElement(XmlElement el)
		{
			try 
			{
				map["ConnectionType"]=el.Name;
				XmlNodeList children = el.ChildNodes;
				map["name"]=el.GetAttribute("name");
				foreach(XmlElement childEl in children)
				{
					map[childEl.Name]=childEl.InnerText;
				}
				if ((!map.Contains("Port")) || (((string) map["Port"]).Equals("")))
				{
					map["Port"]=defaultPort;
				}
			}
			catch(Cmn.ReflectionException)
			{
				//TODO: Throw some other kind of exception.
			}
			catch(Exception)
			{
				//TODO: Throw some other kind of exception.
			}
		}
		public bool containsField(string nameAddress)
		{
			// TODO:  Add MessagingConnection.containsField implementation
			return map.Contains(nameAddress);
		}

		public bool isGetOnly
		{
			get
			{
				return false;
			}
		}

		public Swaf.Container.XmlSerializationSupport SerializationSupport
		{
			get
			{
				return new Swaf.Container.XmlSerializationSupport ();
			}
		}

		public void put(string nameAddress, object val, object extraInfo)
		{
			map[nameAddress]=val;
		}

		public void put(string nameAddress, object val)
		{
			map[nameAddress]=val;
		}

		public string getXml(string options)
		{
			StringWriter buffer = new StringWriter();
			string connectionType = (string) map["ConnectionType"];
			string xml="";
			ICollection keys = map.Keys;
			int keyCount=map.Count;

			buffer.Write("<");
			buffer.Write(connectionType);
			buffer.Write(">");
			foreach(string key in keys)
			{
				if (! key.Equals("ConnectionType"))
				{
					buffer.WriteLine(nodeDef(key,(string) map[key]));			
				}
			}

			buffer.Write("</");
			buffer.Write(connectionType);
			buffer.Write(">");
			xml= buffer.ToString();
			buffer.Close();
			return xml;

		}
		private string nodeDef(string nodeName,string nodeValue)
		{
			StringWriter buffer = new StringWriter();
			string node="";
			buffer.Write("<");
			buffer.Write(nodeName);
			buffer.Write(">");
			buffer.Write(nodeValue);
			buffer.Write("</");
			buffer.Write(nodeName);
			buffer.Write(">");
			node= buffer.ToString();
			buffer.Close();
			return node;
		}
		public object get(string nameAddress)
		{
			// TODO:  Add MessagingConnection.get implementation
			if (nameAddress == null)
				return this;
			return map[nameAddress];
		}

		object Swaf.Container.INameAddressSupport.get(string nameAddress, object oneArg)
		{
			return get(nameAddress);
		}

		object Swaf.Container.INameAddressSupport.get(string nameAddress, params object[] infoArgs)
		{
			// TODO:  Add MessagingConnection.Swaf.Container.INameAddressSupport.get implementation
			return get(nameAddress);
		}

		public string Xml
		{
			get
			{
				// TODO:  Add MessagingConnection.Xml getter implementation
				return getXml("");
			}
		}

		#endregion

	}
}
*/